package com.monitor.search;

import com.monitor.model.Admin;
import com.monitor.pubInter.BaseSearch;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
/**
*   @author afeng
*   @Date 2025-03-17 10:50:13
*   @description AdminSearch      系统用户
*/


@Data
@ApiModel("系统用户AdminSearch")
public abstract class AdminSearch<Sub extends AdminSearch<Sub>> extends BaseSearch {
    @ApiModelProperty(value = "用户名")
    private String usernameEq;
    @ApiModelProperty(value = "手机号码")
    private String phoneLike;
    @ApiModelProperty(value = "手机号码")
    private String phoneEq;
    @ApiModelProperty(value = "是否禁用")
    private List forbiddenIn;
    @ApiModelProperty(value = "角色 1:客服:Customer,2:账务:Finance,3:管理员:manage")
    private Integer roleIdEq;
    @ApiModelProperty(value = "大于排序")
    private Integer sortNumGreater;
    @ApiModelProperty(value = "小于排序")
    private Integer sortNumLess;
    @ApiModelProperty(value = "是否显示 1:是:Y,0:否:N")
    private List showFlagIn;
    @ApiModelProperty(value = "是否删除 1:删除:Y,0:正常:N")
    private Integer delFlagEq=0;

    public AdminSearch() {
        setDelFlagEq(0);
    }



    /**
    * 返回子类Sub
    * @return
    */
    public abstract Sub getSubThis();

    @Override
    public String createTimeFiled() {
        return Admin.CREATE_TIME;
    }
    @Override
    public String updateTimeFiled() {
        return Admin.UPDATE_TIME;
    }
    @Override
    public String  setDefaultField() {
        return Admin.CREATE_TIME;
    }
    @Override
    public String pkField() {
        return Admin.ID;
    }

    @Override
    public String  toString() {
        return "AdminSearch{}"+super.toString();
    }
    public Sub setUsernameEq(String usernameEq){
        this.usernameEq = usernameEq;
        setEqualField(Admin.USERNAME, usernameEq);
        return getSubThis();
    }
    public Sub setPhoneLike(String phoneLike){
        this.phoneLike = phoneLike;
        setLikeField(Admin.PHONE, phoneLike);
        return getSubThis();
    }
    public Sub setPhoneEq(String phoneEq){
        this.phoneEq = phoneEq;
        setLikeField(Admin.PHONE, phoneEq);
        return getSubThis();
    }

    public Sub setForbiddenIn(List forbiddenIn){
        this.forbiddenIn = forbiddenIn;
        setInField(Admin.FORBIDDEN, forbiddenIn);
        return getSubThis();
    }
    public Sub setRoleIdEq(Integer roleIdEq){
        this.roleIdEq = roleIdEq;
        setEqualField(Admin.ROLE_ID, String.valueOf(roleIdEq));
        return getSubThis();
    }
    public Sub setSortNumGreater(Integer sortNumGreater){
        this.sortNumGreater = sortNumGreater;
        setGreaterField(Admin.SORT_NUM, sortNumGreater);
        return getSubThis();
    }
    public Sub setSortNumLess(Integer sortNumLess){
        this.sortNumLess = sortNumLess;
        setLessField(Admin.SORT_NUM, sortNumLess);
        return getSubThis();
    }
    public Sub setShowFlagIn(List showFlagIn){
        this.showFlagIn = showFlagIn;
        setInField(Admin.SHOW_FLAG, showFlagIn);
        return getSubThis();
    }
    public Sub setDelFlagEq(Integer delFlagEq){
        this.delFlagEq = delFlagEq;
        setEqualField(Admin.DEL_FLAG, String.valueOf(delFlagEq));
        return getSubThis();
    }
}